String.prototype.colorRgb = function(){  
    //十六进制颜色值的正则表达式 
    var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
    var sColor = this.toLowerCase();  
    if(sColor && reg.test(sColor)){  
        if(sColor.length === 4){  
            var sColorNew = "#";  
            for(var i=1; i<4; i+=1){  
                sColorNew += sColor.slice(i,i+1).concat(sColor.slice(i,i+1));     
            }  
            sColor = sColorNew;  
        }  
        //处理六位的颜色值  
        var sColorChange = [];  
        for(var ii=1; ii<7; ii+=2){  
            sColorChange.push(parseInt("0x"+sColor.slice(ii,ii+2)));    
        }  
        return "RGB(" + sColorChange.join(",") + ")";  
    }else{  
        return sColor;    
    }  
};